package main

import "fmt"

func updateSlice(s []int)  {
	s[0] =100
	
}
func main() {

	arr := [...]int{0,1,2,3,4,5,6,7}
	s := arr[2:6]
	s1 := arr[2:]
	s2 := arr[:6]

	fmt.Println("arr[2]",arr[2])
	fmt.Println("arr[2:6]",s)
	fmt.Println("arr[2:]",arr[2:])
	fmt.Println("arr[:6]",arr[:6])
	fmt.Println("arr[:]",arr[:])

	updateSlice(s1)
	fmt.Println(s1)
	fmt.Println(arr)

	updateSlice(s2)
	fmt.Println(s2)
	fmt.Println(arr)

	fmt.Println(s2)
	s2 = s2[:5]
	fmt.Println(s2)
	s2 = s2[2:]
	fmt.Println(s2)
	s2 = s2[4:5]
	fmt.Println(s2)
	s2[0]=99

	s3 := append(s2,10)
	s4 := append(s3,10)
	s5 := append(s4,10)
	fmt.Println(s5)
	fmt.Println(s2,len(s2),cap(s2))
	fmt.Println(arr)


}
